import pygame
import sys


class Pyinit:
    def __init__(self):
        pass

    def show_rect(self, x, y, w, h):
        pygame.draw.rect(self.screen, (100,100,100), (x, y, w, h))

    def start(self, winx, winy, fps):
        pygame.init()
        self.screen = pygame.display.set_mode((winx, winy))
        fclock = pygame.time.Clock()
        while True:
            self.event_handler()
            pygame.display.update()
            fclock.tick(fps)

    def event_handler(self):
        for e in pygame.event.get():
            if e.type == pygame.QUIT:
                pygame.quit()
                sys.exit()


if __name__ == '__main__':
    pyinit = Pyinit()
    pyinit.start(300, 400, 10)

